﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace QLCONGNOAPPs.BaseControls.DungDD_BC
{
    public partial class BaseControl_D : UserControl
    {

        public event EventHandler PressNew = null;
        public event EventHandler PressEdit = null;
        public event EventHandler PressDelete = null;
        public event EventHandler PressPrint = null;
        public event EventHandler PressRefresh = null;
        public event EventHandler PressRestore = null;
        public event EventHandler PressHelp = null;

        public BaseControl_D()
        {
            InitializeComponent();
            
        }

        public void disableBtnKhoiPhuc()
        {
            btnKhoiPhuc.Enabled = false;
        }

        public void enableBtnLhoiPhuc()
        {
            btnKhoiPhuc.Enabled = true;
        }
        private void btnThem_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if(PressNew!=null)
            {
                PressNew(sender, e);
            }
        }

        private void btnCapNhat_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (PressEdit != null)
            {
                PressEdit(sender, e);
            }
        }

        private void btnXoa_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (PressDelete != null)
            {
                PressDelete(sender, e);
            }
        }

        private void btnIn_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (PressPrint != null)
            {
                PressPrint(sender, e);
            }
        }

        private void btnNapLai_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (PressRefresh != null)
            {
                PressRefresh(sender, e);
            }
        }

        private void btnKhoiPhuc_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (PressRestore != null)
            {
                PressRestore(sender, e);
            }
        }

        private void btnTroGiup_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (PressHelp != null)
            {
                PressHelp(sender, e);
            }
        }
    }
}
